{{#extends @html/widget/hp/widget.html}}

{{:widget_class}}wg-hotdocs{{/:widget_class}}

{{:widget_body}}
	{{!connect "theme/widget/hotdoc.css"}}
	<div class="typography">
		{{?widget.tdi_not_found}}
		<p>Виджет не настроен.</p>
		{{?:}}
		<!-- {{?widget.image_src}}<img border="0" src="{{widget.image_src}}">{{/?}}-->
		{{?widget.image_oid}}<img border="0" src="{{widget.image_oid | link_to 'imagestorage'}}">{{/?}}
		{{widget.anonce}}<br>
		Документ: <a href="{{widget.doc_url}}">{{widget.doc_data.title}}</a><br>
		<i>{{widget.doc_data.announce | safe}}</i><br>
		Автор: {{widget.user_full_name}}<br>
		Коментариев: {{widget.comments_count}}<br>
		{{/?}}
	</div>
{{/:widget_body}}

{{:settings}}
<div class="popup-body" id="settings_container"><div class="bg1-">
	<form action="" id="settingsform">
	<input type="hidden" name="widget_id" value="{{settings.id}}" id="widget_id" />
	<h2 class="title-">{{settings.form.title}}</h2>
	<div class="content-">
		{{!for settings.form.fields as='field' do=@:formfield}}
		<b>Изображение</b><br>
		<input type="hidden" name="image_oid" id="image_oid"/>
		<iframe style="height: 70px; border: 0; width: 100%;" src="{{settings.form.iframe_url}}"></iframe>
	</div>
	{{@:settingsbutton}}
	</form>
</div></div>
<script type="text/javascript">
new HotDocSettingsForm({{settings.id}});
</script>
{{/:settings}}

{{:image}}
{{?is_image}}<form method="post" enctype="multipart/form-data">
<input type="hidden" name="del_img" value="1">
<a href="#" onclick="this.parentNode.submit()">Remove</a>
</form>{{/?}}
{{?error!=null}}!{{error}}!{{/?}}
<form method="post" enctype="multipart/form-data">
<input type="file" name="img_file" onchange="submit()">
</form>
<script type="text/javascript">
window.parent.document.getElementById('image_oid').value = "{{image_id}}";
</script>
{{/:image}}
